package com.weimei.conversionTreasure.fragment;

import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;

import com.weimei.conversionTreasure.R;
import com.weimei.conversionTreasure.app.AppViewModelFactory;
import com.weimei.conversionTreasure.databinding.LayoutFragmentOneBinding;
import com.weimei.conversionTreasure.viewModel.AddRecordVM;
import com.weimei.conversionTreasure.viewModel.TabOneVM;

import me.goldze.mvvmhabit.base.BaseFragment;
import me.tatarka.bindingcollectionadapter2.BR;

public class TabOneFragment extends BaseFragment<LayoutFragmentOneBinding, TabOneVM> {
    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.layout_fragment_one;
    }

    @Override
    public int initVariableId() {
        return BR.viewModel;
    }

    @Override
    public TabOneVM initViewModel() {
        return ViewModelProviders.of(this,
                (ViewModelProvider.Factory) AppViewModelFactory.getInstance(getActivity().getApplication()))
                .get(TabOneVM.class);

    }

    @Override
    public void initData() {
        super.initData();
        viewModel.setView(binding.tvContent);
    }
}
